
<%@ page import="weblicitacao.Empenho"%>
<!doctype html>
<html>
<head>
<meta name="layout" content="main">
<g:set var="entityName"
	value="${message(code: 'empenho.label', default: 'Empenho')}" />
<title><g:message code="default.show.label" args="[entityName]" /></title>
</head>
<body>
	<a href="#show-empenho" class="skip" tabindex="-1"><g:message
			code="default.link.skip.label" default="Skip to content&hellip;" /></a>
	<div class="nav" role="navigation">
		<ul>
			<li><a class="home" href="${createLink(uri: '/')}"><g:message
						code="default.home.label" /></a></li>
			<li><g:link class="list" action="list">
					<g:message code="default.list.label" args="[entityName]" />
				</g:link></li>
			<li><g:link class="create" action="create">
					<g:message code="default.new.label" args="[entityName]" />
				</g:link></li>
		</ul>
	</div>
	<div id="show-empenho" class="content scaffold-show" role="main">
		<h1>
			<g:message code="default.show.label" args="[entityName]" />
		</h1>
		<g:if test="${flash.message}">
			<div class="message" role="status">
				${flash.message}
			</div>
		</g:if>
		<ol class="property-list empenho">

			<g:if test="${empenhoInstance?.numero}">
				<li class="fieldcontain"><span id="numero-label"
					class="property-label"><g:message
							code="empenho.numero.label" default="Numero" /></span> <span
					class="property-value" aria-labelledby="numero-label"><g:fieldValue
							bean="${empenhoInstance}" field="numero" /></span></li>
			</g:if>

			<g:if test="${empenhoInstance?.numeroDaLicitacao}">
				<li class="fieldcontain"><span id="numeroDaLicitacao-label"
					class="property-label"><g:message
							code="empenho.numeroDaLicitacao.label"
							default="Numero Da Licitacao" /></span> <span class="property-value"
					aria-labelledby="numeroDaLicitacao-label"><g:fieldValue
							bean="${empenhoInstance}" field="numeroDaLicitacao" /></span></li>
			</g:if>

			<g:if test="${empenhoInstance?.empresa}">
				<li class="fieldcontain"><span id="empresa-label"
					class="property-label"><g:message
							code="empenho.empresa.label" default="Empresa" /></span> <span
					class="property-value" aria-labelledby="empresa-label"><g:link
							controller="empresa" action="show"
							id="${empenhoInstance?.empresa?.id}">
							${empenhoInstance?.empresa?.encodeAsHTML()}
						</g:link></span></li>
			</g:if>

			<g:if test="${empenhoInstance?.data}">
				<li class="fieldcontain"><span id="data-label"
					class="property-label"><g:message code="empenho.data.label"
							default="Data" /></span> <span class="property-value"
					aria-labelledby="data-label"><g:formatDate
							date="${empenhoInstance?.data}" /></span></li>
			</g:if>

		</ol>
		<g:form>
			<fieldset class="buttons">
				<g:hiddenField name="id" value="${empenhoInstance?.id}" />
				<g:link class="edit" action="edit" id="${empenhoInstance?.id}">
					<g:message code="default.button.edit.label" default="Edit" />
				</g:link>
				<g:actionSubmit class="delete" action="delete"
					value="${message(code: 'default.button.delete.label', default: 'Delete')}"
					onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
			</fieldset>
		</g:form>

		<div id=Itens>

			<div id="list-item" class="content scaffold-list" role="main">
				<h1>Itens</h1>
				<table>
					<thead>
						<tr>

							<g:sortableColumn property="numero"
								title="${message(code: 'item.numero.label', default: 'Numero')}" />

							<g:sortableColumn property="descricao"
								title="${message(code: 'item.descricao.label', default: 'Descricao')}" />

							<g:sortableColumn property="quantidade"
								title="${message(code: 'item.quantidade.label', default: 'Quantidade')}" />

							<g:sortableColumn property="valorUnitario"
								title="${message(code: 'item.valorUnitario.label', default: 'Valor Unitario')}" />

						</tr>
					</thead>
					<tbody>
						<g:each in="${itemInstanceList}" status="i" var="itemInstance">
							<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

								<td><g:link action="show" id="${itemInstance.id}">
										${fieldValue(bean: itemInstance, field: "numero")}
									</g:link></td>

								<td>
									${fieldValue(bean: itemInstance, field: "descricao")}
								</td>

								<td>
									${fieldValue(bean: itemInstance, field: "quantidade")}
								</td>

								<td>
									${fieldValue(bean: itemInstance, field: "valorUnitario")}
								</td>

								<td class="link"><g:link action="addItemEmpenho"
										idItem="${itemInstance.id}" class="btn btn-small">Adicionar</g:link>
								</td>

							</tr>
						</g:each>
					</tbody>
				</table>
			</div>

			<div id="list-itemEmpenho" class="content scaffold-list" role="main">
				<h1>Itens no Empenho</h1>
				<table>
					<thead>
						<tr>

							<th><g:message code="itemEmpenho.item.label" default="Item" /></th>

							<th><g:message code="itemEmpenho.lote.label" default="Lote" /></th>

							<th><g:message code="itemEmpenho.empenho.label"
									default="Empenho" /></th>

						</tr>
					</thead>
					<tbody>
						<g:each in="${itemEmpenhoInstanceList}" status="i"
							var="itemEmpenhoInstance">
							<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

								<td><g:link action="show" id="${itemEmpenhoInstance.id}">
										${fieldValue(bean: itemEmpenhoInstance, field: "item")}
									</g:link></td>

								<td>
									${fieldValue(bean: itemEmpenhoInstance, field: "lote")}
								</td>

								<td>
									${fieldValue(bean: itemEmpenhoInstance, field: "empenho")}
								</td>

								<td class="link"><g:link action="delItemEmpenho"
										idItem="${itemEmpenhoInstance.id}" class="btn btn-small">Remover</g:link>
								</td>

							</tr>
						</g:each>
					</tbody>
				</table>
			</div>
		</div>

		<div id='Lotes'>

			<div id="list-lote" class="content scaffold-list" role="main">
				<h1>Lotes</h1>
				<table>
					<thead>
						<tr>

							<g:sortableColumn property="descricao"
								title="${message(code: 'lote.descricao.label', default: 'Descricao')}" />

							<g:sortableColumn property="quantidadeDeItens"
								title="${message(code: 'lote.quantidadeDeItens.label', default: 'Quantidade De Itens')}" />

							<g:sortableColumn property="prazoDeEntrega"
								title="${message(code: 'lote.prazoDeEntrega.label', default: 'Prazo De Entrega')}" />

							<th><g:message code="lote.licitacao.label"
									default="Licitacao" /></th>

						</tr>
					</thead>
					<tbody>
						<g:each in="${loteInstanceList}" status="i" var="loteInstance">
							<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

								<td><g:link action="show" id="${loteInstance.id}">
										${fieldValue(bean: loteInstance, field: "descricao")}
									</g:link></td>

								<td>
									${fieldValue(bean: loteInstance, field: "quantidadeDeItens")}
								</td>

								<td>
									${fieldValue(bean: loteInstance, field: "prazoDeEntrega")}
								</td>

								<td>
									${fieldValue(bean: loteInstance, field: "licitacao")}
								</td>

								<td class="link"><g:link action="addLoteEmpenho"
										idLote="${loteInstance.id}" class="btn btn-small">Adicionar</g:link>
								</td>

							</tr>
						</g:each>
					</tbody>
				</table>
			</div>

			<div id="list-itemEmpenho" class="content scaffold-list" role="main">
				<h1>Lotes no Empenho</h1>
				<table>
					<thead>
						<tr>

							<th><g:message code="itemEmpenho.item.label" default="Item" /></th>

							<th><g:message code="itemEmpenho.lote.label" default="Lote" /></th>

							<th><g:message code="itemEmpenho.empenho.label"
									default="Empenho" /></th>

						</tr>
					</thead>
					<tbody>
						<g:each in="${itemEmpenhoInstanceList}" status="i"
							var="itemEmpenhoInstance">
							<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

								<td><g:link action="show" id="${itemEmpenhoInstance.id}">
										${fieldValue(bean: itemEmpenhoInstance, field: "item")}
									</g:link></td>

								<td>
									${fieldValue(bean: itemEmpenhoInstance, field: "lote")}
								</td>

								<td>
									${fieldValue(bean: itemEmpenhoInstance, field: "empenho")}
								</td>

								<td class="link"><g:link action="delItemEmpenho"
										idLote="${itemEmpenhoInstance.id}" class="btn btn-small">Remover</g:link>
								</td>

							</tr>
						</g:each>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</body>
</html>
